package cn.liujianbo.example.validate.entity.user;

import cn.liujianbo.example.validate.valid.ValidateGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * @author 刘建波
 * @date 2020-12-24 14:40
 */
@Data
public class Address {
    @Null(message = "新增操作id必须为空!", groups = ValidateGroup.Add.class)
    @NotNull(message = "id 不能为空!", groups = ValidateGroup.Update.class)
    private Long id;
    @NotBlank(message = "province不能为空!")
    private String province;
    @NotBlank(message = "name不能为空!", groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    private String city;
    @NotBlank(message = "name不能为空!", groups = {ValidateGroup.Add.class, ValidateGroup.Update.class})
    private String area;
}
